import { post } from '@/api/requestApi'

const BASE_URL = '/api/ChatRecord/'

const API_URL = {
  GET_USER_CHAT_RECORD_PAGES: 'GetUserChatRecordPages', //  分页获取单聊记录
  SYNC_CHAT_RECORD: 'SyncChatRecord', //  同步聊天记录
  GET_USER_CONVLIST_PAGES:'GetUserConvListPages', //分页获取会话列表
  GET_USER_CHATRECORD_PAGES_BY_USERID:'GetUserChatRecordPagesByUserId',// 会话内容
  DELETE_C2CCONV:'DeleteC2cConv', //删除会话
}

for (const i in API_URL) {
  API_URL[i] = BASE_URL + API_URL[i]
}
/**
 * 删除会话
 * @param data
 * @returns {*}
 * @constructor
 */
export function DeleteC2cConv(data) {
  return post(API_URL.DELETE_C2CCONV, data)
}

/**
 * 分页获取单聊记录
 * @param data
 * @returns {*}
 * @constructor
 */
export function GetUserChatRecordPages(data) {
  return post(API_URL.GET_USER_CHAT_RECORD_PAGES, data)
}

/**
 * 同步聊天记录
 * @param data
 * @returns {*}
 * @constructor
 */
export function SyncChatRecord(data) {
  return post(API_URL.SYNC_CHAT_RECORD, data)
}

/**
 * 同步聊天记录
 * @param data
 * @returns {*}
 * @constructor
 */
export function GetUserConvListPages(data) {
  return post(API_URL.GET_USER_CONVLIST_PAGES, data)
}

/**
 * 同步聊天记录
 * @param data
 * @returns {*}
 * @constructor
 */
export function GetUserChatRecordPagesByUserId(data) {
  return post(API_URL.GET_USER_CHATRECORD_PAGES_BY_USERID, data)
}
